import { createApp } from 'vue'
// global css
import 'element-plus/theme-chalk/dark/css-vars.css'
import '@/assets/styles/main.scss'
import 'element-plus/theme-chalk/src/message-box.scss'
import 'element-plus/theme-chalk/src/message.scss'
// App、router、store、pinia
//import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import store from './store'
// 国际化
import i18n from '@/lang/index'
const app = createApp(App)

// 如果您正在使用CDN引入，请删除下面一行图标。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

import components from '@/components/index' //全局组件注册
import crud from '@/components/crud/index' //全局组件注册
import '@/mockjs/index' // 启动 Mock

// 全局方法挂载--这种VUE官方介意不要这样挂载
//import { useDict } from '@/utils/dict'
//app.config.globalProperties.useDict = useDict

// app.use(createPinia())
import microApp from '@micro-zoe/micro-app'

import ElementPlus from 'element-plus' //引入element-plus库
import VForm3 from 'vform3-builds' //引入VForm3库

import 'element-plus/dist/index.css' //引入element-plus样式
import 'vform3-builds/dist/designer.style.css' //引入VForm3样式

import gridLayout from 'vue-grid-layout'
app.use(ElementPlus) //全局注册element-plus
app.use(VForm3) //全局注册VForm3(同时注册了v-form-designe、v-form-render等组件)
app.use(router)
app.use(i18n)
app.use(store)
app.use(components)
app.use(crud)
app.use(gridLayout) //注册gridLayout
app.mount('#app')
